import request from '@/utils/request'

// 请求素材列表
export const getMaterialList = () => {
  return request({
    method: 'get',
    url: '/materialList/'
  })
}

export const getMaterialCategory = (data) => {
  return request({
    method: 'get',
    url: `/materialList?materialCategory=${data}`
  })
}

export const getMaterialName = (data, value) => {
  return request({
    method: 'get',
    url: `/materialList?materialName=${data}&uploaderId=${value}`
  })
}

export const modifyData = (id, data) => {
  return request({
    method: 'put',
    url: `/materialList/${id}`,
    data
  })
}

export const getNewDate = () => {
  return request({
    method: 'get',
    url: '/newDate/'
  })
}
export const uploadDate = (data) => {
  return request({
    method: 'post',
    url: '/materialList',
    data
  })
}
